package com.yamanyar.weebill.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yamanyar.weebill.dao.ActionDAO;
import com.yamanyar.weebill.domain.Action;
import com.yamanyar.weebill.service.ActionService;
/**
 * Implementation of <code>ActionService</code> interface.
 * Created in Jun 28, 2008.
 * @see ActionService
 * @author Kaan Yamanyar
 */
@Service
public class ActionServiceImpl implements ActionService {

	private ActionDAO actionDAO;

	@Autowired
	public ActionServiceImpl(ActionDAO actionDAO) {
		this.actionDAO = actionDAO;
	}

	public void createNew(Action action) {
		actionDAO.persist(action);
	}

	public List<Action> findAll() {
		return actionDAO.loadAll();
	}

	public List<Action> findByName(String name) {
		return actionDAO.findByName(name);
	}

	public Action getActionWithID(Long id) {
		return actionDAO.loadById(id);
	}

}
